General gradient descent algorithm

Iteratively update the parameters 𝐱\mathbf{x} by making small adjustment that decreases f(𝐱)f(\mathbf{x}).

In particular, update 𝐱←𝐱+η𝐯\mathbf{x} \leftarrow \mathbf{x} + \eta\mathbf{v} where η>0\eta > 0 is step size.

Gradient descent method

Iteratively update the current estimate in the direction opposite the gradient direction

𝐱(l+1)=𝐱(l)−α∂J∂𝐱|𝐱(l)\mathbf{x}^{(l+1)}=\mathbf{x}^{(l)}-\alpha \frac{\partial J}{\partial \mathbf{x}}\Bigr|_{\substack{\mathbf{x}^{(l)}}}

The solution depends on the initial condition. Reaches the local minimum closest to the initial condition if the stepsize is chosen properly.

Yield global optimal if J is convex, regardless initial solution

Gradient descent analysis

Assume:

  • ff is convex
  • Lipschitz function: for all 𝐱\mathbf{x}, ||∇f(𝐱)||2≤G||\nabla f(\mathbf{x})||_2 \leq G
  • starting radius: ||𝐱∗−𝐱(0)||2≤R||\mathbf{x}^{*}-\mathbf{x}^{(0)}||_2 \leq R

Gradient descent:

  • choose number of steps TT
  • starting point 𝐱(0)\mathbf{x}^{(0)}, e.g. 𝐱(0)=0→\mathbf{x}^{(0)} = \vec{0}
  • η=RGT\eta = \frac{R}{G \sqrt{T}}
  • for i=0,…,Ti=0,…,T:
    • 𝐱(i+1)=𝐱(i)−η∇f(𝐱(i))\mathbf{x}^{(i+1)}=\mathbf{x}^{(i)}-\eta \nabla f(\mathbf{x}^{(i)})
  • return 𝐱ˆ=arg⁡min𝐱(i)⁡f(𝐱(i))\hat{\mathbf{x}} = \arg \min_{\mathbf{x}^{(i)}} f(\mathbf{x}^{(i)})

gradient descent convergence bound


Gradient descent for constrained optimization

  • Let η==DGT\eta==\frac{D}{G\sqrt{T}}
  • Let x0x_0 be any point in 𝒦\mathcal{K}.
  • Repeat for i=0i=0 to TT
  • yi+1←xi−η∇f(xi)y_{i+1} \leftarrow x_i -\eta\nabla f(x_i)
  • xi+1←x_{i+1} \leftarrow Projection of yi+1y_{i+1} on 𝒦\mathcal{K}
  • At the end output x‾=1T∑i=0Txi\bar{x}=\frac{1}{T} \sum_{i=0}^T x_i.

DD is the diameter for 𝒦\mathcal{K}, or if unconstrained, then simply an upper bound on ||x0−x∗||||x_0 - x^*||. GG is an upper bund on the size of ff‘s gradient, i.e. ||∇f(x)||2≤G,∀x||\nabla f(x)||_2 \leq G, \forall x.


See: stochastic gradient descent, gradient


References:

  1. https://www.chrismusco.com/amlds2023/notes/lecture06.html#Projected_Gradient_Descent
  2. https://www.chrismusco.com/amlds2023/lectures/lec8_annotated.pdf
  3. https://www.cs.princeton.edu/courses/archive/fall18/cos521/Lectures/lec16.pdf
  4. https://en.wikipedia.org/wiki/Gradient_descent
  5. https://www.stat.cmu.edu/~ryantibs/convexopt-F13/scribes/lec6.pdf
  6. https://scholar.harvard.edu/files/yujietang/files/slides_2019_zero-order_opt_tutorial.pdf
  7. S. P. Boyd and L. Vandenberghe, Convex optimization, Version 29. Cambridge New York Melbourne New Delhi Singapore: Cambridge University Press, 2023. [Online]. Available: https://web.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf